package com.daqian.cloud.oauth2.repository;

import com.daqian.cloud.oauth2.entity.Member;
import org.springframework.stereotype.Service;

/**
 * 账户数据库操作类
 */
@Service
public class MemberRepository {

    /**
     * 根据用户名查找账户信息
     * @param username 用户名
     * @return 账户信息
     */
    public Member findByUserName(String username) {
        Member member = new Member();
        member.setId("1");
        member.setUserName(username);
        // passwordEncoder.encode("123123") = $2a$04$KxlhrFKPhyLcfhnRHxh2TOd19ESJY5Pfg3a6uQirOpXOBbx7vky7q
        member.setPassWord("$2a$04$KxlhrFKPhyLcfhnRHxh2TOd19ESJY5Pfg3a6uQirOpXOBbx7vky7q");
        member.setRoles("USER");
        return member;
    }
}
